using Ease.TestEaseNode.Runtime;
using UnityEngine;
using UnityEngine.UIElements;

namespace Ease.TestEaseNode.Editor
{
    public class TestSettingView : VisualElement
    {
        public new class UxmlFactory : UxmlFactory<TestSettingView, UxmlTraits>
        {
        }

        private UnityEditor.Editor editor;
        private TestDataManager _testDataManager;

        public TestSettingView()
        {
        }

        public void Init(TestDataManager testDataManager)
        {
            _testDataManager = testDataManager;
            CreateEditor(_testDataManager.Setting);
        }

        protected void CreateEditor(Object ob)
        {
            editor = UnityEditor.Editor.CreateEditor(ob);
            IMGUIContainer container = new IMGUIContainer(() => { editor.OnInspectorGUI(); });
            Add(container);
        }
    }
}